import os

import numpy as np
from torch.utils.data import Dataset, dataloader
import torch


class FeatureDataset(Dataset):
    def __init__(self, features_list):
        self.features_list = features_list

    def __getitem__(self, index):
        data = self.features_list[index]

        label = torch.tensor(data[0], dtype=torch.int64)

        input = torch.tensor(data[1:], dtype=torch.float32)

        # print (type(label),type(input))
        return input, label

    def __len__(self):
        return len(self.features_list)

# print (np.loadtxt(open("./features.csv"),delimiter=","))

#
# dataset = FeatureDataset("./features.csv")
#
#
# print (len(dataset))
